/***************************************************************************
*   Copyleft 2008-2009 by												   *
*	 Iwanicki Krzysztof													   *
*   <gamma.mini.pw.edu.pl/~iwanickik>									   *
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
*   This program is distributed in the hope that it will be useful,       *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
*   GNU General Public License for more details.                          *
***************************************************************************/
#ifndef __VFRAMELISTENER_H__
#define __VFRAMELISTENER_H__

#include <Types/vTypes.h>
#include "../../Macros/vMemoryMacros.h"

namespace Vendetta {
	/*! \class vFrameListener
	 *  \brief A vFrameListener abstract class must be implemented to render stuff.
	 *
	 */
	class vFrameListener {
	public:
		/** Struct containing information about a frame event.
		*/
		struct vFrameEvent {
			/*! \brief Elapsed time in seconds since the last event of the same type,i.e. time for a complete frame.
			 *	
			 *	This may not be the elapsed time but the average
			 *	elapsed time between recently fired events of the same type.
			 */
			vReal TimeSinceLastFrame;
		};
	public:
		/*! \brief Default constructor.
		 */	
		vFrameListener() { }

		/*! \brief Default Destructor.
		*/	
		virtual ~vFrameListener () { }

		/*! \brief Abstract method called to update data before rendering starts.
		*/
		virtual vVoid Update(const vFrameEvent& event) = 0;

		/*! \brief Abstract method called after rendering starts.
		*/	
		virtual vVoid BeginFrame(const vFrameEvent& event) = 0;
		
		/*! \brief Abstract method called before rendering ends.
		*/	
		virtual vVoid EndFrame(const vFrameEvent& event) = 0;

		/*! \brief Method called to render buffered geometry.
		*/	
		virtual vVoid RendereBufferedGeometry() { }

	};
}

#endif // __VFRAMELISTENER_H__